Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
manoranjan_d
Specialist
Specialist

interval in the coding

hi all,

i need the interval like below

No of times user logged.

Eg - No of times   No of Users

              0                   10

             1-5                  20

             6-10                30

            11-20               40

            21-40               15

            >41                   5

i tried

LOAD

[user name],

Replace( Class (Count([login details]),10),'<= x <','-') as Login

Resident Main

Group By [user name];

but its not good its howing more interval i need the example interval till >41 is fine. how to do this?

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps like this:

LOAD

[user name],

If(Count([login details])>40, '>40' ,  Replace( Class (Count([login details]),10),'<= x <','-')) as Login

Resident Main

Group By [user name];


talk is cheap, supply exceeds demand
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

You can use Intervalmatch function.

LOAD

[user name],

Count([login details]) as LoginCount

Resident Main

Group By [user name];

_temp:

Load * Inline [

  interName, Min, Max

0, 0, 0

1-5, 1, 5

];

intervalmatch(LoginCount)

Load

Min

Max

resident _temp

;

Help users find answers! Don't forget to mark a solution that worked for you!
manoranjan_d
Specialist
Specialist
Author

hi gysbert  now i want to sort this interval in the bar chart? how to do this?

example:

in bar chart i have used the login as dimension and count(username) as exprseion

now this dimension has to be in proper sort orderof interval form 0 to >40

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Change the line to:

If(Count([login details])>40, dual('>40',41) ,  Replace( Class (Count([login details]),10),'<= x <','-')) as Login

That way you can sort Login numerically


talk is cheap, supply exceeds demand