# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Division of Count in Script

Hi,

I hope you all are doing well. I want to ask one question.

I have two fields in my table having String and Numeric Values

Fields a having 1000 Records & fields B having 700 I want to divide these two Fields and Want to create New Fields as Percentage in Script Itself not in chart.

Data is as below

A                                                       B

35087982308                                35087982308

44058947209                                44058947209

1B007394207                               1B007394207

1H001557008                               1H001557008

1M006698108                               1M006698108

Total=1000                                   Total=700

Total (B)/Total (A) =%

Thanks

7 Replies
Partner

Post a sample app with expected output....

Luminary Alumni

Hi,

Try this.

A:

Let vTableA = NoOfRows('A');

B:

Let vTableB = NoOfRows('B');

Autogenerate 1;

Drop table A,B;

Regards,

Kaushik Solanki

Regards,
Kaushik

Do you mean to count them? in script?

LOAD Count(A) As CountA / Count(B) As Percentage

Resident Data;

Let vPercentage = Num(Peek('Percentage'), '0.0%');

Use Field Percentage or variable vPencentage.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Specialist II

try this in script @

Load Count(A)/Count(B) as percantage resident tablename;

Partner

Hie...

Load Count(A) / Count(B) As Percentage

Resident Data

Group By fieldname;

Regards,

Contributor III
Author

Thank you so much Kaushik for you help

This is what i am looking for

MVP

Hi,

one solution to add a new field in the same table could be:

```//test data generation
table1:
If(Rand()>0.3,Left(KeepChar(Hash256(RecNo()),'01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'),11)) as B
AutoGenerate 1100;

//Percentage field
Left Join (table1)