Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
thabo2g5
Contributor III
Contributor III

Dates

Hi Everyone

i have a datasource in that data i want to flag dates  where system are on peak ( between 24 & 4)  and off-peak ( between 5 & 23) so i want to flag them for every month . please help

thank you in advance

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

Load *,

If(Day(dates) >= 4 and Day(dates) <= 24, 'on peak', If(Day(dates) >= 5 and Day(dates) <= 23, 'off-peak')) as FieldName

Group By dates;

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

6 Replies
Anil_Babu_Samineni

Try this?

Load *,

If(Day(dates) >= 4 and Day(dates) <= 24, 'on peak', If(Day(dates) >= 5 and Day(dates) <= 23, 'off-peak')) as FieldName

Group By dates;

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Kushal_Chawda

Can you please elaborate?

tresesco
MVP
MVP

Group By might not be required, right?

Anil_Babu_Samineni

May be, But the reason i state the Group By here is recently i've faced issue with Unique dates so then i thought to use..

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tresesco
MVP
MVP

But without any aggregation function 'group by' would throw error.

Anil_Babu_Samineni

Again true, I feel it like using Aggregation only. thanks your prompt

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)