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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dual Function

Guys,

Whenever I use dual function in script, I get duplicate values in the list box after loading the data as shown in the below image. Please help me guys....

Screenshot_2.png

20 Replies
Anonymous
Not applicable
Author

mws.png

Now I'm getting like this. I don't need like this, I want only the unique values in the list box and also when I write expression in text object, it should be like this....text obj.png

txt.png

Plz help me, and you guys getting what I'm trying to say?

vinieme12
Champion III
Champion III

Your script should be

DUAL (If (billablehrs >7,'billable',if (billablehrs <1,'non billable','partially billable')),billablehrs) as projecthrs_status,

Please post script / expression content as text if you want ppl to help you better

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anil_Babu_Samineni

I am not sure, I understand why it is not working. See, In my Application i've done with Duplicate in front end I got only unique names.

Capture.PNG

Check this and if still getting same issue try to share sample application why it is not working. We may look those same

I used this in List Box. Can you copy your expression on List box and then see whether Duplicate will repeat or not enclosed is attached for ref


=If(Dem='A', 'Anil', If(Dem='B', 'Babu', If(Dem='C', 'Samineni','Samineni')))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sanjay006
Creator
Creator

Short the second dimension alphabetically.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

For good measure, here are somme points of attention when dealing with the dual() function. You can use them to decide whether dual() is a fit for your situation:

  • Dual() creates a dual value with both a text and number representation. They become inseparable.
  • When dual values are stored in a field, they can repeat the text representation for different numeric vlaues, but they cannot repeat the numeric representation with a different text value. Each number can only have one text value. That's the way a field symbol table works.
  • When using dual values in your document scripts and expressions, the text value will be used for displaying values, and the number value will be used for sorting and calculations. Although this behavior is also context-sensitive in some situations.

The multiple identical strings in your listbox are there because it displays the text values for different numerical values. The listbox in your screenshot contains only three text values tied to 6 different numerical values. The text values are displayed, but the numerical values are used for sorting and filling the listbox. This effect is identical to the one you get when you create date values for all days in a single month, and you then attach date format string 'MM-YYYY' to those individual date values. That results in a listbox with 31 identical 'May-2017' strings for the current month.

sanjay006
Creator
Creator

Sir !

So can we short this expression by string ? instead of numbers. I want this to be shorted in alphabetically order.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You mean 'sorted', not blowing fuses? Yes you can. In the sort tab, select Text and a suitable order.

sanjay006
Creator
Creator

But It's not working . I have attached the file i need the second dimension should be shorted alphabetically .

sanjay006
Creator
Creator

Sir !

But It's not working . I have attached the file i need the second dimension

should be shorted alphabetically .

Thanks & Regards,

Sanjay Gupta

BI. Consultant - Business Intelligence

Ph(+91)7042094738 Skype:sanjaymail006

IRT Digital Analytics Solutions

Pvt. Ltd.

On Mon, May 15, 2017 at 4:27 PM, Peter Cammaert <qcwebmaster@qlikview.com>

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Better create a new discussion for this.