简体   繁体   中英

Unable to write SSRS expression

My query result set is:

Eid Cycle1 Cycle2 Cycle3 Cycle4 CountOfCycle
 1   0.75    0      0      0         2

The result in the SSRS report should be:

Eid Cycle1 Cycle2 Cycle3 Cycle4 CountOfCycle
 1   0.75    1      0      0         2 

Depending on the countofcycles, 0s should be converted to 1s in the SSRS report.If there is a value already for the cycle, it should be left in that cycle. Another example:

Eid Cycle1 Cycle2 Cycle3 Cycle4 CountOfCycle
 1   0.75    0      0      0         3

SSRS report would be:

Eid Cycle1 Cycle2 Cycle3 Cycle4 CountOfCycle
 1   0.75    1      1      0         3

I am unable to code it in SSRS using expression.Depending on the value of CountOfCycle I have to convert 0s to 1s. CountOfCycle is the number of cycles with some value other than 0.

It's not entirely clear what your criteria is, but I think the expression would be:

Cycle2:

If(Cycle2 = 0 AndAlso CountOfCycle >= 2, 1, Cycle2)

Cycle3:

If(Cycle3 = 0 AndAlso CountOfCycle >= 3, 1, Cycle3)

And so on...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM