Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension IF statament

Hi guys

I am very new in Qlikview and I am trying to add a calculated dimension.

=IF(YearWeek=vOpsWk,'Week',

  IF(YearWeek>=vOpsWk_4 and YearWeek<vOpsWk,'MTD'

  ))

when the dimension generate it also return me the "else" data.

how can I avoid this? Please see the picture. I don't want the last line.

Capture.GIF.gif

Thanks

7 Replies
Not applicable
Author

Hi,

Check " Suppress When values is Null" option in the Dimension tab.

Remove null Values In dimension.png

Best,

Robert

Not applicable
Author

Thanks a lot Robert

How about if I only want to use 'Week'

Use the "Settings for Selected Dimension" if so can you please show the how this works?

Also the "IF" statement in Qlikview looks like can't avoid filter out the else at the beginning.

Not applicable
Author

Hi,

Only for Week

=IF(YearWeek=vOpsWk,'Week',null())

Check " Suppress When values is Null" option in the Dimension tab.

Best,

Robert

jyothish8807
Master II
Master II

Hi Yihang,

=IF(YearWeek=vOpsWk,Week,

  IF(YearWeek >=vOpsWk_4 and YearWeek <vOpsWk,MTD))

Try this. And can please elobrate your requirment a bit more.

Regards

KC

Best Regards,
KC
Not applicable
Author

Hi Robert

I just tried

"

Only for Week

=IF(YearWeek=vOpsWk,'Week',null())

Check " Suppress When values is Null" option in the Dimension tab."

And it not work. it only filter out the last rows (same as only check " Suppress When values is Null" option in the Dimension tab.) .


Not applicable
Author

Hi,

can you try something like this :  =IF(YearWeek=vOpsWk,'Week')

or

Can i get the your sample QVW file.

Best,

Robert

Not applicable
Author

Please find my sample qvw file

Thanks

Btw I tried '=IF(YearWeek=vOpsWk,'Week')' and not works as well .

Cheers