Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lishuang
Contributor III
Contributor III

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
Master II
Master II

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

View solution in original post

2 Replies
harishkumarg
Creator III
Creator III

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

Regards

Harish

jyothish8807
Master II
Master II

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