Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
lishuang
Not applicable

set the dimension to two time periods

Hi All!

I want to set the dimension to two time periods in the morning and in the afternoon.How should I write the expression?

Thanks in advance!

1 Solution

Accepted Solutions
jyothish8807
Not applicable

Re: set the dimension to two time periods

Hi,

Add required two dimension in the chart and put conditional show condition on both:

Dim1 (Afternoon)

=if(num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))> num(maketime(12,01,00)),1,0)

Dim2 (Morning)

=if(num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))> num(maketime(00,00,00)) and num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))< num(maketime(12,00,00)),1,0)


Regards

KC

Best Regards,
KC
2 Replies
harishkumarg
Not applicable

Re: set the dimension to two time periods

Do you mean @ morning you need one dimension (Dimension A) and @ afternoon another dimension (Dimension B) and the expression remains same?

Regards

Harish

jyothish8807
Not applicable

Re: set the dimension to two time periods

Hi,

Add required two dimension in the chart and put conditional show condition on both:

Dim1 (Afternoon)

=if(num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))> num(maketime(12,01,00)),1,0)

Dim2 (Morning)

=if(num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))> num(maketime(00,00,00)) and num(subfield(now(),' ',2)& ' '&subfield(now(),' ',3))< num(maketime(12,00,00)),1,0)


Regards

KC

Best Regards,
KC