Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
jagdishbr
Contributor III
Contributor III

Expression Error as Zero or "-"

Hi everyone, i'm new to qliksense and would appreciate some guidance on the following expression and error.

in a straight table, I have columns for current and previous rank for various products and I need to calculate the difference between the current rank and the previous rank and ended up  "Zero" or "-"

jagdishbr_0-1724154565482.png

 

Tried below expressions

Current Rank   = {<period={'FY23}>}w_rank 

Previous Rank = {<period={'FY22}>}w_rank

1. Rank Diff = {<period={'FY23}>}w_rank  - {<period={'FY22}>}w_rank  (Ended up with "-")

2. Rank Diff = MAX({<period={'FY23}>} w_rank)  - MAX({<period={'FY22}>} w_rank)  (Ended up with "-")

3. Rank Diff = Alt(Max(Column1),0)- Alt(Max(Column2),0) (Ended up with 0)

could some one please shed some light on the issue?

 

 

 

Labels (5)
1 Reply
F_B
Specialist
Specialist

Hi @jagdishbr ,

well, first thing I see, you are missing the apostrophe:

= {<period={'FY23'}>}w_rank

 

Second, I would suggest you to create some master measures, like for Current Rank and Previous Rank, this way you can recall them whenever you want and, in your table, subtract Current Rank from Previous Rank.

 

Third, if there is a field with dates, instead of using the flags FY23 and FY22, you can use some variables to make it update dinamically.

 

Hope this can help you